<div class="wrapper wrapper-content ">
    <div class="tabs-container">
        <ul class="nav nav-tabs">
            <li class="active"><a data-toggle="tab" href="#tab-1" data-type="-1" aria-expanded="true">支出</a></li>
            <li class=""><a data-toggle="tab" href="#tab-2" data-type="1" aria-expanded="false"> 收入</a></li>
            <li class=""><a data-toggle="tab" href="#tab-3" data-type="0" aria-expanded="false"> 转账</a></li>
        </ul>
        <div class="tab-content">
            <div id="tab-1" class="tab-pane active">
                <div class="panel-body">
                    <form class="form-horizontal" method="post" action="{:url('BkTransaction/add')}">
                        <input type="hidden" name="type" value="-1">
                        <div class="form-group">
                            <label class="col-sm-1 control-label">{:lang('金额')}</label>
                            <div class="col-sm-2">
                                <input name="amount" class="form-control" type="text" placeholder=""/>
                                <span class="help-block m-b-none"></span>
                            </div>
                            <label class="col-sm-1 control-label">{:lang('分类')}</label>
                            <div class="col-sm-2">
                                <div class="suggest-search-box">
                                    <div class="input-group category-suggest">
                                        <input type="hidden" name="category_id"
                                               value="{$history.category_id|default=''}">
                                        <input type="text" name="category_name"
                                               value="{$history.category_name|default=''}"
                                               class="form-control suggest-input" placeholder="{:lang('选择分类')}"
                                               data-url="{:url('Comm/suggest_search',array('datatype'=>'category'))}"
                                               searchFields="keywords" value="{$info.category_name|default=''}"
                                               target-group="category-suggest"
                                               target-name='{"category_id":"id","category_name":"name"}'
                                               source-group="form-horizontal"
                                               source-name='{"type":"{:lang("类型")}"}'
                                        >
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default dropdown-toggle"
                                                    data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                        </div>
                                    </div>
                                </div>
                                <span class="help-block m-b-none"></span>
                            </div>
                            <label class="col-sm-1 control-label">{:lang('账户')}</label>
                            <div class="col-sm-2">
                                <div class="suggest-search-box">
                                    <div class="input-group account-suggest">
                                        <input type="hidden" name="account_id" value="{$history.account_id|default=''}">
                                        <input type="text" name="account_name"
                                               value="{$history.account_name|default=''}"
                                               class="form-control suggest-input" placeholder="{:lang('选择账户')}"
                                               data-url="{:url('Comm/suggest_search',array('datatype'=>'account','type'=>'-1'))}"
                                               searchFields="keywords" value="{$info.account_name|default=''}"
                                               target-group="account-suggest"
                                               target-name='{"account_id":"id","account_name":"name"}'>
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default dropdown-toggle"
                                                    data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                        </div>
                                    </div>
                                </div>
                                <span class="help-block m-b-none"></span>
                            </div>
                            <label class="col-sm-1 control-label">{:lang('成员')}</label>
                            <div class="col-sm-2">
                                <div class="suggest-search-box">
                                    <div class="input-group person-suggest">
                                        <input type="hidden" name="person_id" value="{$history.person_id|default=''}">
                                        <input type="text" name="person_name" value="{$history.person_name|default=''}"
                                               class="form-control suggest-input" placeholder="{:lang('选择成员')}"
                                               data-url="{:url('Comm/suggest_search',array('datatype'=>'person','type'=>'-1'))}"
                                               searchFields="keywords" value="{$info.person_name|default=''}"
                                               target-group="person-suggest"
                                               target-name='{"person_id":"id","person_name":"name"}'>
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default dropdown-toggle"
                                                    data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                        </div>
                                    </div>
                                </div>
                                <span class="help-block m-b-none"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">{:lang('时间')}</label>
                            <div class="col-sm-2">
                                <input type="text" name="transaction_date" class="form-control datepicker"
                                       value="{$bill_date|default=''|format_time='Y-m-d'}">
                            </div>
                            <label class="col-sm-1 control-label">{:lang('商家')}</label>
                            <div class="col-sm-2">
                                <div class="suggest-search-box">
                                    <div class="input-group shop-suggest">
                                        <input type="hidden" name="shop_id" value="{$history.shop_id|default=''}">
                                        <input type="text" name="shop_name" value="{$history.shop_name|default=''}"
                                               class="form-control suggest-input" placeholder="{:lang('选择商家')}"
                                               data-url="{:url('Comm/suggest_search',array('datatype'=>'shop','type'=>'-1'))}"
                                               searchFields="keywords" value="{$info.shop_name|default=''}"
                                               target-group="shop-suggest"
                                               target-name='{"shop_id":"id","shop_name":"name"}'>
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default dropdown-toggle"
                                                    data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <label class="col-sm-1 control-label">{:lang('项目')}</label>
                            <div class="col-sm-2">
                                <div class="suggest-search-box">
                                    <div class="input-group project-suggest">
                                        <input type="hidden" name="project_id" value="{$history.project_id|default=''}">
                                        <input type="text" name="project_name"
                                               value="{$history.project_name|default=''}"
                                               class="form-control suggest-input" placeholder="{:lang('选择项目')}"
                                               data-url="{:url('Comm/suggest_search',array('datatype'=>'project','type'=>'-1'))}"
                                               searchFields="keywords" value="{$info.project_name|default=''}"
                                               target-group="project-suggest"
                                               target-name='{"project_id":"id","project_name":"name"}'>
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default dropdown-toggle"
                                                    data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">{:lang('备注')}</label>
                            <div class="col-sm-8">
                                <input type="text" name="remark" class="form-control">
                            </div>
                            <label class="col-sm-1 control-label"></label>
                            <div class="col-sm-2">
                                <button class="btn btn-info btn-block" type="submit"> 保 存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="row m-t-md">
        <div class="col-sm-12">
            <div class="ibox-content">
                <div class="row">
                    <form method="post" class="form-inline addlist-form">
                        <div class="col-sm-8">
                            <div data-toggle="buttons" class="btn-group">
                                <label class="btn btn-sm btn-info btn-outline active">
                                    <input type="radio" value="month" name="period_type" checked>{:lang('本月度')}
                                </label>
                                <label class="btn btn-sm btn-info btn-outline">
                                    <input type="radio" value="quarter" name="period_type" >{:lang('本季度')}
                                </label>
                                <label class="btn btn-sm btn-info btn-outline">
                                    <input type="radio" value="year" name="period_type">{:lang('本年度')}
                                </label>
                            </div>
                            <div class="input-group">
                                <input type="text" name="keywords" placeholder="{:lang('关键字搜索')}"
                                       class="form-control">
                            </div>
                            <div class="input-group">
                                    <span class="input-group-btn">
                                        <button type="button" class="btn btn-primary">
                                            <i class="fa fa-search"></i> {:lang('查询')}</button>
                                    </span>
                            </div>
                        </div>
                        <div class="col-sm-4 text-right">
                            <p class="form-control-static font-bold ">
                                <span class="text-success">收入：<b class="income-money">1500.00</b></span>
                                <span class="text-danger m-l-md">支出：<b class="expense-money">2555.55</b></span>
                                <span class="text-justify  m-l-md">结余：<b class="balance-money">2555.55</b></span>
                            </p>
                        </div>
                    </form>
                </div>
            </div>
            <div class="ibox-content table-responsive">
                <table class="table table-hover addlist-table-list"
                       data-url="{:url('BkTransaction/addLists')}"
                       width="100%">
                    <thead>
                    <tr>
                        <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                        <th width="100"><span>{:lang('日期')}</span></th>
                        <th width="100"><span>{:lang('分类')}</span></th>
                        <th width="200"><span>{:lang('金额')}</span></th>
                        <th width="80"><span>{:lang('账户')}</span></th>
                        <th width="80"><span>{:lang('成员')}</span></th>
                        <th width="80"><span>{:lang('商家')}</span></th>
                        <th width="80"><span>{:lang('项目')}</span></th>
                        <th width="80"><span>{:lang('备注')}</span></th>
                        <th width="80" class="text-center">{:lang('操作')}</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</div>
{include file="bookkeep/_bk_transaction/fun"}

